import request from '@/utils/request'

export const getArticleList = function (params) {
  return request.get('/h5/interview/query', { params })
}

export const getArticleLike = function (page) {
  return request.get('/h5/interview/opt/list', {
    params: {
      optType: 1,
      pageSize: 10,
      page
    }
  })
}

export const getArticleCollect = function (page) {
  return request.get('/h5/interview/opt/list', {
    params: {
      optType: 2,
      pageSize: 10,
      page
    }
  })
}

export const getArticleDetail = function (id) {
  return request.get('/h5/interview/show', {
    params: { id }
  })
}

export const updateCollect = function (id) {
  return request.post('/h5/interview/opt', {
    id,
    optType: 2 // 选择操作收藏
  })
}

export const updateLike = function (id) {
  return request.post('/h5/interview/opt', {
    id,
    optType: 1 // 选择操作点赞
  })
}
